package com.example.rcmanager.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

public class SharedPrefHelper {
	public static String getStringFromSP(Context c, String key ,String defaulData){
		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(c);
		return preferences.getString(key, defaulData);
	}
	public static void putDataStringToSP(Context c, String key,String value){
		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(c);
		Editor editor = preferences.edit();
		editor.putString(key, value);
		editor.commit();
	}
	public static Boolean getBooleanFromSP(Context c, String key ,Boolean defaulData){
		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(c);
		return preferences.getBoolean(key, defaulData);
	}
	public static void putDataBooleanToSP(Context c, String key,Boolean value){
		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(c);
		Editor editor = preferences.edit();
		editor.putBoolean(key, value);
		editor.commit();
	}
}
